/*
 * @Author: wcx 1055127249@qq.com
 * @Date: 2025-01-07 17:31:03
 * @LastEditors: wcx 1055127249@qq.com
 * @LastEditTime: 2025-01-14 10:53:44
 * @FilePath: \my-project\src\views\CreateProcess\register\activity.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Graph } from '@antv/x6'
import { createPods } from '../register/ports'
Graph.registerNode('gateway', {
  width: 100,
  height: 60,
  markup: [
    {
      tagName: 'rect',
      selector: 'body',
    },
    {
      tagName: 'image',
      selector: 'avatar',
    },
    {
      tagName: 'text',
      selector: 'label',
    },
    {
      tagName: 'text',
      selector: 'error',
    },
  ],
  attrs: {
    body: {
      rx: 10,
      ry: 10,
      strokeWidth: 2,
      refWidth: '100%',
      refHeight: '100%',
      stroke: '#5F95FF',
      fill: 'transparent',
      pointerEvents: 'visiblePainted',
    },
    avatar: {
      x: 6,
      y: 6,
      width: 16,
      height: 16,
      'xlink:href': '/icon-user.png',
    },
    label: {
      x: 50,
      y: 30,
      refWidth: '100%',
      refHeight: '100%',
      fontSize: 12,
      textAnchor: 'middle',
      textVerticalAnchor: 'middle',
    },
    error: {
      x: 1,
      y: 80,
      fill: '#f00',
      fontSize: 12,
      textAnchor: 'start',
      textVerticalAnchor: 'bottom',
    },
  },
  ports: createPods('top', 'left', 'bottom', 'right')
}, true)